import Vue from 'vue'
import VueRouter from 'vue-router'
import home from '../views/home.vue'

Vue.use(VueRouter)

const routes = [
  {path: '/', name: 'home', component: home},
  {path: '/articleDetail/:id', name: 'articleDetail', component: () => import('../views/articleDetail.vue')},
  {path: '/articleTypes', name: 'articleTypes', component: () => import('../views/articleTypes.vue')},
  {path: '/articleType/:id', name: 'articleType', component: () => import('../views/articleType.vue')},
  {path: '/guestBook', name: 'guestBook', component: () => import('../views/guestBook.vue')},
  {path: '/about', name: 'about', component: () => import('../views/about.vue')},
  {path: '/searchArticles', name: 'searchArticles', component: () => import('../views/searchArticles.vue')},
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
